package com.k.kppcloud.consumer.feign;

import com.k.kppcloud.consumer.feign.fallback.HelloFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 测似乎绝对地址
 * 只会访问绝对路径的服务，无负载均衡
 * 想要负载均衡只能是第一种形式，或者通过网关进行负载均衡
 */
@FeignClient(name = "service-inner-provider-two",url = "${kpp.provider.feign-url}",fallback = HelloFallback.class)
public interface HelloTwoService {
    @RequestMapping(value = "/api/sayHelloParams", method = RequestMethod.POST)
    String sayHelloParams(@RequestBody List<String> userNameList);

    /**
     * 无负载调用
     * @return Result
     */
    @RequestMapping(value = "/api/sayHello", method = RequestMethod.GET)
    String sayHello();
}
